home *** CD-ROM | disk | FTP | other *** search
/ Aminet 15 / Aminet 15 - Nov 1996.iso / Aminet / dev / misc / BST_SystemDocs.lha / BeastV1 / Examples / BST_System / BST_Example4.txt < prev    next >
Encoding:
Text File  |  1996-03-31  |  1.3 KB  |  33 lines

  1.  
  2. Example4.c
  3. ==========
  4.  
  5. This example shows the use of dynamic parent/child behaviour.
  6. The example class is a simple 'Double' class, which just has
  7. 1 instance field (Number N).
  8.  
  9. How it works
  10. ------------
  11.  
  12. The 'my_DoubleClass' only has two method defined;
  13.  
  14. OBM_GETATTR - Set's the BTA_LongNumber to the object instance N. It also
  15.           print's out the N values of the parent objects. See the
  16.           OBJ_MethodToParent function, technically spoken the MTHF_DOPARENTS
  17.           flag in this example could be omited. This because only
  18.           one parent object will be called, why?, there is only one
  19.           value to fill in (BTA_NumberOf = 1), after this the MTHF_DOPARENTS
  20.           flag is reset.
  21.           It is good practice (and required) to set the MTHF_DOPARENTS flag
  22.           because it is possible that there are _other_ objects inserted
  23.           between your objects.
  24.  
  25. OBM_SETATTR - Set's the instance N to BTA_LongNumber. It sets also the children
  26.           objects if the MTHF_PASSTOCHILD was set. To do this the ti_Data
  27.           is multiplied by 2, the nr_attr is increased with 1 because
  28.           otherwise the BTA_NumberOf tag is processed and the MethodFlags
  29.           will be reseted. Finally the BTF_Ignore is cleared.
  30.  
  31. Now one OBM_SETATTR call of the root parent object with the MTHF_PASSTOCHILD
  32. flags is enough to set all objects.
  33.